package com.asset.dispoal.verdict.service.converter;

import com.asset.dispoal.verdict.domain.db.entity.GbJudgmentBookItem;
import com.asset.dispoal.verdict.dto.request.CreateOrEditItemRequest;
import com.asset.dispoal.verdict.dto.request.JudgmentItemRequest;
import com.asset.dispoal.verdict.dto.response.JudgmentItemResponse;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * @description:
 * @author: yf
 * @date: 2022-09-06
 */
@Mapper
public interface GbJudgmentBookItemConverter {
    GbJudgmentBookItemConverter INSTANCE = Mappers.getMapper(GbJudgmentBookItemConverter.class);

    GbJudgmentBookItem reqToDo(JudgmentItemRequest request);

    List<JudgmentItemResponse> dosToRes(List<GbJudgmentBookItem> judgmentBookItems);

    @Mapping(source = "request.judgmentBookItemDetailList", target = "judgmentBookItemDetailList")
    GbJudgmentBookItem reqToDoItem(CreateOrEditItemRequest request);
}
